<?php
/********************************************************************************* 
 * Power By Oversea (C) All Right Reserved
 * Class -> collected all the execution at the backend interface
 * For oversea member limited
 * ----------------------------------------------
 * Designer: Cavin Zhang
 * Date: Feb 13, 2012
 * ---------------------------------------------
 * Amendment By:
 * Date:
 ******************************************************/
abstract class usrActionExecutedCollection {
	
	protected $userPersonalID;
	protected $funcType;
	/*ActionTYpe -> del,new,upd*/
	protected $actionType; 
	protected $userShortID;
	
	public function __construct($userid,$tagtype,$opt) {
		$this -> userPersonalID = $userid;
		$this -> funcType = $tagtype;
		$this -> actionType = $opt;
		$this -> userShortID = getTempUserId($userid);
	}
	
	public function chooseAssociatedCategory()
	{
		global $dbObj;
		if(!is_object($dbObj))
		{
			$dbObj = new CsDatabaseOpera();
		}
		switch ($this->actionType)
		{
			case 'del':
				$this -> chooseRelevantDelFunction($dbObj);
				break;
			case 'new':
				$this -> chooseRelevantAddFunction($dbObj);
				break;
			case 'upd':
				$this -> chooseRelevantFunction($dbObj);
				break;
			case 'ajax':
				$this -> chooseRelevantAjaxFunction($dbObj);
				break;
		}
	}
	
	//for deletion
	protected abstract function chooseRelevantDelFunction(CsDatabaseOpera $dbObj);
	//for addition
	protected abstract function chooseRelevantAddFunction(CsDatabaseOpera $dbObj);
	//for updating
	protected abstract function chooseRelevantFunction(CsDatabaseOpera $dbObj);
	//for getting information via ajax
	protected abstract function chooseRelevantAjaxFunction(CsDatabaseOpera $dbObj);
}

?>